from math import pi
from numpy import NaN
import sympy as sym
from collections.abc import Iterable
def f(arg1,arg2):
    if(len(arg1) != len(arg2)):
        return False
    else:
        for i in range(0,len(arg1)):
            if(arg1[i] == sym.nan and arg2[i] == sym.nan):
                continue
            if(sym.Eq(sym.simplify(arg1[i]),sym.simplify(arg2[i])) != True):
                return False
        return True
def isequaln(*args):
    arg1 = args[0]
    for i in range(1,len(args)):
        if(isinstance(arg1,Iterable) and isinstance(args[i],Iterable)):
            if f(arg1,args[i]) == False:
                return False
        elif(not isinstance(arg1,Iterable) and (not isinstance(args[i],Iterable))):
            if(sym.Eq(args[i],arg1) == True):
                pass
            else:
                return False
        else:
            return False
    return True
a,b,c,x = sym.symbols("a,b,c,x")
re = a*x**2+b*x+c
d = sym.solve(re,x)
kk = [(-b - sym.sqrt(-4*a*c + b**2))/(2*a), (-b + sym.sqrt(-4*a*c + b**2))/(2*a)]

NaN = sym.nan
NaN1 = sym.nan
print(NaN == NaN1)
print(sym.Eq(NaN, NaN1))
p = pi
print(p)
p1 = sym.pi
print(sym.Eq(p, p1))
A1 = [x,NaN,NaN]
A2 = [x,NaN,NaN]
A3 = [x,NaN,NaN]
tf = isequaln(A1,A2,A3)
print(d)
print(isequaln(d,kk))
print(tf)
print(sym.simplify(sym.root(-3,-27)))